package com.mycompany.app.hr.organization.model;

import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

import com.mycompany.app.hr.pa.model.Employee;

/**
 * Operation is the biggest organization level currently in client’s WuXi site.
 * Check duplicated operation code Check the operation Head Check cost center
 * mapping: When Deleting an Operation, the system will check whether or not
 * there is cost center related to the operation. If Yes, the deletion can’t be
 * successful, an exception will be thrown. equals with [Division] in Payroll
 * module.
 * 
 * @author Shawn.guo
 */
@Entity
@Table(name="org_operation")
public class Operation {

    @Id
    @Column(name = "cost_center_id")
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

    @Column(name = "operation_code")
    private String code;

    private String payrollNumber;

    private String Name;

    private String description;

    private String header;

    private Employee operationHead;

    private Boolean isActive;

    private Set<CostCenter> costcenterSet;

    // =========================
    @Override
    public String toString() {

        return ToStringBuilder.reflectionToString(this,
                ToStringStyle.SHORT_PREFIX_STYLE);
    }

    // =========================

    public String getCode() {

        return code;
    }

    public void setCode(String code) {

        this.code = code;
    }

    public String getPayrollNumber() {

        return payrollNumber;
    }

    public void setPayrollNumber(String payrollNumber) {

        this.payrollNumber = payrollNumber;
    }

    public String getName() {

        return Name;
    }

    public void setName(String name) {

        Name = name;
    }

    public String getDescription() {

        return description;
    }

    public void setDescription(String description) {

        this.description = description;
    }

    public String getHeader() {

        return header;
    }

    public void setHeader(String header) {

        this.header = header;
    }

    public Employee getOperationHead() {

        return operationHead;
    }

    public void setOperationHead(Employee operationHead) {

        this.operationHead = operationHead;
    }

    public Boolean getIsActive() {

        return isActive;
    }

    public void setIsActive(Boolean isActive) {

        this.isActive = isActive;
    }

    public Set<CostCenter> getCostcenterSet() {

        return costcenterSet;
    }

    public void setCostcenterSet(Set<CostCenter> costcenterSet) {

        this.costcenterSet = costcenterSet;
    }

    public Long getId() {
    
        return id;
    }

    public void setId(Long id) {
    
        this.id = id;
    }
    

}
